package com.zhang.entity;

/**
 * @author: 96199
 * @className: Retuntity
 * @description:
 * @date: 2021/6/23 14:35
 * @version: 0.1
 * @since: jdk1.8
 */

public class Retuntity<T> {
    private T data;
    private Integer code;
    private String msg;

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Retuntity() {
    }

    public Retuntity(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Retuntity(T data, Integer code, String msg) {
        this.data = data;
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }



    public void setUser(T data) {
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public static Retuntity success(String msg){
        return new Retuntity(200,msg);
    }
    public static Retuntity error(int code,String msg){
        return new Retuntity(code,msg);
    }


    @Override
    public String toString() {
        return "Retuntity{" +
                "data=" + data +
                ", code=" + code +
                ", msg='" + msg + '\'' +
                '}';
    }
}
